﻿// code03050302.cpp : 数组
// begin和end函数

#include <iostream>
using namespace std;
//找到数组中出现的负数
int main()
{
    int ia[] = { 0,1,2,3,4,5,6,7,8,9 };
    int* pbeg = begin(ia);
    int* pend = end(ia);
    while (pbeg!=pend&&*pbeg>=0)
    {
        ++pbeg;
    }
    if (pbeg!=pend)
    {
        cout << *pbeg << endl;
    }
    else
    {
        cout << "没有找到负数" << endl;
    }
    return 0;

}

